/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.validator;

import com.minierp.model.PayMode;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

public class PayModeValidator implements Validator {
	public boolean supports(Class clazz) {
		return PayMode.class.isAssignableFrom(clazz);
	}

	public void validate(Object obj, Errors errors) {
		PayMode form = (PayMode) obj;
		if (form.getModeName() == null || form.getModeName().trim().equals("")) {
			errors.rejectValue("modeName", "", "请输入『名称』");
		}

	}
}